package com.bishe.demo.modules.hotel.hotelPolicy.dao;

import com.bishe.demo.modules.hotel.hotelPolicy.entity.PolicyUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface PolicyUserDao {
    @Insert("insert into hotel_policy_user values(null,#{policyId},#{userId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertPolicyUser(PolicyUser policyUser);

    @Delete("delete from hotel_policy_user where policy_id=#{policyId}")
    void deleteByPolicyId(int policyId);
}
